﻿@model RiverCruise.Models.ShipManagement.NewShipViewModel

@{
    ViewBag.Title = "New Ship";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div class="container-fluid">
    <h2>New Ship</h2>
    
    @using (Html.BeginForm("AddShip", "ShipManagement", FormMethod.Post, new { @class = "form-horizontal" }))
    {
        @Html.AntiForgeryToken()
        @Html.HiddenFor(model => Model.Comany.Name)
        @Html.HiddenFor(model => Model.Comany.Id)

        if (!ViewData.ModelState.IsValid)
        {
            <div class="bs-callout bs-callout-danger text-danger ">
                @Html.ValidationSummary()
            </div>
        }

        if (Model.ShipModified)
        {
            <div class="bs-callout bs-callout-succes text-success ">
                <ul>
                    <li>Ship added</li>
                </ul>
            </div>
        }

        <div class="form-group">
            @Html.LabelFor(model => model.Comany.Name, new { @class = "col-sm-2 control-label" })
            <div class="col-sm-10">
                <input type="text" disabled="disabled" value="@Model.Comany.Name" class="form-control disabled"/>
            </div>
        </div>
        

        <div class="form-group">
            @Html.LabelFor(model => model.Name, new { @class = "col-sm-2 control-label" })
            <div class="col-sm-10">
                @Html.TextBoxFor(model => model.Name, new { @class = "form-control", placeholder = "Name" })
                <span class="text-danger">@Html.ValidationMessageFor(model => model.Name)</span>
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Eni, new { @class = "col-sm-2 control-label" })
            <div class="col-sm-10">
                @Html.TextBoxFor(model => model.Eni, new { @class = "form-control", placeholder = "Eni" })
                <span class="text-danger">@Html.ValidationMessageFor(model => model.Eni)</span>
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Flag, new { @class = "col-sm-2 control-label" })
            <div class="col-sm-10">
                @Html.TextBoxFor(model => model.Flag, new { @class = "form-control", placeholder = "Flag" })
                <span class="text-danger">@Html.ValidationMessageFor(model => model.Flag)</span>
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Region, new { @class = "col-sm-2 control-label" })
            <div class="col-sm-10">
                @Html.TextBoxFor(model => model.Region, new { @class = "form-control", placeholder = "Region" })
                <span class="text-danger">@Html.ValidationMessageFor(model => model.Region)</span>
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.NauticalCrew, new { @class = "col-sm-2 control-label" })
            <div class="col-sm-10">
                @Html.TextBoxFor(model => model.NauticalCrew, new { @class = "form-control", placeholder = "0" })
                <span class="text-danger">@Html.ValidationMessageFor(model => model.NauticalCrew)</span>
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.HotselStaff, new { @class = "col-sm-2 control-label" })
            <div class="col-sm-10">
                @Html.TextBoxFor(model => model.HotselStaff, new { @class = "form-control", placeholder = "0" })
                <span class="text-danger">@Html.ValidationMessageFor(model => model.HotselStaff)</span>
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Since, new { @class = "col-sm-2 control-label" })
            <div class="col-sm-10">
                @Html.TextBoxFor(model => model.Since,"{0:MM/dd/yyyy}", new { @class = "form-control datepicker datepicker-defaultDate" })
                <span class="text-danger">@Html.ValidationMessageFor(model => model.Since)</span>
            </div>
        </div>

            <br />
        <div class="form-group">
            <div class="col-sm-2 ">
                <span>@Html.ActionLink("Back to detail", "Detail", "Company", new { Id = Model.Comany.Id }, new { @class = "btn btn-block btn-warning" })</span>
            </div>
            <div class="col-sm-10">
                <button type="submit" class="btn btn-primary form-control">Create</button>
            </div>
        </div>
    }
</div>